package kadledav.adventure.framework.controll.commands;

import java.io.PrintStream;
import java.util.List;
import java.util.Scanner;

import kadledav.adventure.framework.controll.ControllConstants;
import kadledav.adventure.framework.controll.commands.abstr.MoveItemCommand;
import kadledav.adventure.framework.model.world.Item;
import kadledav.adventure.framework.model.world.Player;

public class DropCommand extends MoveItemCommand {

	public DropCommand(PrintStream out, Scanner in, Player player) {
		super(out, in, player);
	}

	@Override
	protected void doTheCommand(Item item) {
		if(player.dropItem(item)){
			out.println("Odlozil jsem predmet: "+item.getName());
		}else{
			out.println("Predmet "+item.getName()+" nelze odlozit");
		}
		out.println();
	}

	@Override
	protected String getCommadnPrefix() {
		return ControllConstants.INVENTORY_ITEM_PREFIX;
	}
	
	@Override
	protected List<Item> getItemsSource() {
		return player.getInventoryItems();
	}

}
